<template>
  <div class="text">
    <div class="title">{{info.title}}</div>
    <div class="time">{{info.createTime?info.createTime:tips}}</div>
    <div class="main">
      <p v-html="info.content"></p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: "",
      info: "",
      tips: ""
    };
  },
  mounted() {},
  watch: {
    id: function() {
      this.getTextInfo();
    }
  },
  methods: {
    getTextInfo() {
      this.$axios.post("/OpenApi/article/" + this.id).then(res => {
        console.log("文本详情", res);
        this.info = res.data;
        if (!this.info) {
          this.tips = "暂无数据~";
        }
      });
      // this.$axios.post("/OpenApi/article/65").then(res=>{
      //   console.log('文本详情',res)
      //   this.info = res.data
      // })
    }
  }
};
</script>

<style lang="scss" scoped>
.text {
  .title {
    margin-top: 30px;
    text-align: center;
    color: #383838;
    font-size: 20px;
    font-weight: bold;
  }
  .time {
    margin-top: 4px;
    text-align: center;
    color: #808080;
    font-size: 12px;
  }
  .main {
    text-align: left;
    font-size: 16px;
    margin: 30px 20px;
    line-height: 22px;
    color: #383838;
  }
}
</style>